package com.cskaoyan.service;


import com.cskaoyan.bean.pojo.Region;
import com.cskaoyan.bean.pojo.RegionExample;
import com.cskaoyan.mapper.RegionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional(rollbackFor =Exception.class )
@Service
public class WxRegionServiceImpl implements WxRegionService {
    @Autowired
    RegionMapper regionMapper;


    @Override
    public List<Region> queryRegionList(Integer pid) {
        RegionExample regionExample = new RegionExample();
        RegionExample.Criteria criteria = regionExample.createCriteria();
        criteria.andPidEqualTo(pid);
        List<Region> regions = regionMapper.selectByExample(regionExample);
        return regions;

    }
}
